import React from 'react';
import { Typography } from 'antd';
import cls from 'classnames';

export interface ITypographyProps {
  borderColor?: any;
  style?: React.CSSProperties;
  level?: 5 | 4 | 3 | 2 | 1;
  children: any;
}

export const TypographyTitle: React.FC<ITypographyProps> = ({ borderColor, children, style, level }) => {
  return (
    <Typography.Title
      className={cls('typ-custom-title')}
      level={level ?? 5}
      style={{
        borderColor,
        paddingLeft: '.5rem',
        ...style,
      }}
    >
      {children ?? '暂无标题'}
    </Typography.Title>
  );
};
